# 练习 打印出 “我爱孙悟空” 其中孙悟空为变量填充
# str = "孙悟空"
# print("我爱"+ str)
#
# print("我爱",str)
# c = f'我爱{str}'
# print(c)
# d = f"我爱"+ str
# print(d)
#
# q = "我爱%s"%str
# print(q)
#
# ss = "abc"
#
# ss = ss*20
#
# print(ss)

# name='马冬梅'
# age=18
# score=98.5
# print('姓名:%s,年龄:%d,成绩:%f' % (name,age,score))
# print('姓名:%s,年龄:%d,成绩:%.1f' % (name,age,score))

# coding:utf-8
s='helloWorld'
print('{0:*<20}'.format(s)) #字符串的显示宽度是20，左对齐,空白部分使用* 号填充
print('{0:*>20}'.format(s)) #右对齐
print('{0:*^20}'.format(s)) #居中对齐
print(s.center(20,"*"))
